<?php
class StaticTextFieldWidget extends Widget{
	private function translateText($txt)
	{
			$url='<a href="'.SITE_URL.'/index.php?s=/space/';
			//$url='<a href="http://localhost/thinksns1.6/index.php?s=/space/';
			return preg_replace("/@(.+?)\((\d+)\)([\s|:]|$)/is",$url.'${2}">@${1}${3}</a>' ,$txt);
	}
	public function render($data){
		$data['content']=$this->translateText($data['content']);
		/*$api=new TS_API();
		$opt=$api->option_get('thinksns');
		$data['bq_emotion'] = D('Smile')->getSmile($opt['ico_type']);
		$data['site_opts']=$opt;*/
        $content = $this->renderFile("StaticTextField",$data);

        return $content;

    }

}
?>